home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / INSTANCE.PAK / INSTANCE.CPP next >
C/C++ Source or Header  |  1997-05-06  |  1KB  |  52 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1991, 1995 by Borland International, All Rights Reserved
  4. //----------------------------------------------------------------------------
  5. #include <owl/pch.h>
  6. #include <owl/applicat.h>
  7. #include <owl/framewin.h>
  8. #include <winsys/system.h>
  9. #include <string.h>
  10.  
  11. //
  12. // class TTestApp
  13. // ~~~~~ ~~~~~~~~
  14. class TTestApp : public TApplication {
  15.   public:
  16.     TTestApp()
  17.     :
  18.       TApplication("Instance Tester")
  19.     {
  20.       WindowTitle = "Additional Instance";
  21.     }
  22.  
  23.   protected:
  24.     string WindowTitle;
  25.  
  26.     // With per-instance data (supported under NT), every instance looks
  27.     // like the first since each has its own independent data segment & cannot
  28.     // share segments, i.e. GetInstanceData() is not supported.
  29.     //
  30.     void InitApplication()
  31.     {
  32.       if (TSystem::SupportsInstanceData())
  33.         WindowTitle = "An Instance";
  34.       else
  35.         WindowTitle = "First Instance";
  36.     }
  37.  
  38.     void InitMainWindow()
  39.     {
  40.       MainWindow = new TFrameWindow(0, WindowTitle.c_str());
  41.     }
  42. };
  43.  
  44. //
  45. //
  46. //
  47. int
  48. OwlMain(int /*argc*/, char* /*argv*/ [])
  49. {
  50.   return TTestApp().Run();
  51. }
  52.